package com.star.star.Activity;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.star.star.R;
import com.star.star.adapter.LeftAdapter;
import com.star.star.bean.aidBean;

import java.util.ArrayList;
import java.util.List;

import static androidx.recyclerview.widget.LinearLayoutManager.VERTICAL;

public class AidListActivity extends AppCompatActivity implements View.OnClickListener {
    private RecyclerView mRecylerView;
    private TextView tv_main_title,tv_back;
    @SuppressLint("WrongConstant")
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_aid_list);
        mRecylerView = findViewById(R.id.rv_recycleview);
        tv_back =  findViewById(R.id.tv_back);
        tv_main_title =  findViewById(R.id.tv_main_title);
        tv_main_title.setText("资讯");
        tv_back.setOnClickListener(this);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(VERTICAL);
        mRecylerView.setLayoutManager(layoutManager);
        List<aidBean> daBeans = new ArrayList<>();
        String image = "https://img.ixiumei.com/uploadfile/2019/1206/20191206101927751.jpg";
        String name = "横店群演改做直播引起网友热议，横店是国内知名的影视城，一直都有很多群演在那里谋生，但如今影视寒冬来临，很多群演只好去做直播，来看看到底是怎么回事";
        for (int i = 0; i < 10; i++) {
            daBeans.add(new aidBean(name, image, "11点20分", "1000", "15"));
        }
        LeftAdapter adapte = new LeftAdapter(this, daBeans);
        mRecylerView.setAdapter(adapte);
        adapte.notifyDataSetChanged();
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv_back:
                AidListActivity.this.finish();
                break;
        }
    }
}
